package ec.edu.ups.cidi.siia.plamdep.moduloweb.dao;

import javax.persistence.Query;

import ec.edu.ups.cidi.siia.plamdep.moduloweb.modeloBD.Analisis;

public class AnalisisDAO extends JPAGenericDAO<Analisis, Long>
{
	
	public AnalisisDAO()
	{
		super(Analisis.class);
	}
	
	public Analisis buscarPorPeticion(String pet)
	{
		try{
		Query q= em.createNativeQuery("select * from analisis where anl_peticion_id =?", Analisis.class);
		q.setParameter(1, pet);
		
		return (Analisis)q.getSingleResult();
		}catch(Exception e){return null;}	
	}
}
